package com.vehicle.app.controller.demo;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.vehicle.app.api.demo.IDemoService;
import com.vehicle.app.entity.demo.Demo;
import com.vehicle.core.exception.ServiceException;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author shouhan
 * @since 2019-01-07
 */
@RestController
@RequestMapping("/demo")
@Api(value = "测试接口",tags = "测试接口")
public class DemoController {

    @Autowired
    private IDemoService demoService;

    @GetMapping(value = "list")
    public String test() {
        EntityWrapper<Demo> wrapper = new EntityWrapper<>();
        List<Demo> list = demoService.selectList(wrapper);
        if (1 == 1) {
            throw new ServiceException(123);
        }
        return "测试";
    }

}

